var whiteTheme = document.getElementsByName("white");
var blackTheme = document.getElementsByName("black");
var html = document.querySelector("html");

//先判断有没有保存的主题信息，有就用哪个信息
if (localStorage.theme) {
  html.className = localStorage.theme;
}

whiteTheme[0].onclick = function () {
  html.className = "white-theme";
  //把主题信息存储在本地，下次再打开网页就不会变了
  localStorage.setItem("theme", "white-theme");
};
blackTheme[0].onclick = function () {
  html.className = "black-theme";
  localStorage.setItem("theme", "black-theme");
};
